package com.mapapp.flutter_mapapp.adapter;

import android.graphics.Color;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.widget.TextView;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.mapapp.flutter_mapapp.R;
import com.mapapp.flutter_mapapp.bean.WaitForUploading;

import java.util.List;

public class UploadDataAdapter extends BaseQuickAdapter<WaitForUploading, BaseViewHolder> {


    public UploadDataAdapter(int layoutResId, @Nullable List<WaitForUploading> data) {
        super(layoutResId, data);
    }

    @Override
    protected void convert(@NonNull BaseViewHolder helper, WaitForUploading item) {
        helper.setText(R.id.tv_household, item.getAddress());
        helper.getView(R.id.iv_check).setSelected(item.isSelect());
        TextView view = helper.getView(R.id.tv_household);
        if (item.isUploadFailed()) {
            view.setTextColor(Color.RED);
        } else {
            view.setTextColor(Color.parseColor("#3e3e3e"));
        }
    }
}
